"""
    以面向对象的思想实现：
        小明在招商银行取钱
"""

class Person:
    def __init__(self, name, money=0):
      self.name = name
      self.money = money
      
    @property
    def name(self):
        return self.__name
      
    @name.setter
    def name(self, name):
        # if name is str:
        self.__name = name

    
    @property
    def money(self):
        return self.__money
    @money.setter
    def money(self, money):
        self.__money = money

    # 取钱
    def quqian(self, money, type):
        print(self.name, end='')
        type.atm(money)
        

class CMBC:
    def __init__(self, money=100000):
        self.money = money
    
    @property
    def money(self):
        return self.money
    @money.setter
    def money(self, money):
        self.__money = money
    
    def atm(self, money):
        self.__money -= money
        Person.money += money
        print(f"取出了{money}块钱。")

zs = CMBC()
r = Person("小明")
r.quqian(50000, zs)
print(r.money)
    